<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
  .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  .login{
    height: 100%;
    overflow: scroll;
  }
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
<template>
  <div class="login">
    <button @click="clkbtn">123</button>
  </div>
</template>

<script>
export default {
  name: "login",
  sockets:{
    connect(){
      this.id=this.$socket.id
      console.log(this.id);
    },
    customEmit(val){  
      console.log(val)
    }
  },
  data() {
    return {
      id:''
    };
  },
  mounted() {
    this.$socket.emit('chat', 'hello world2222ddd!')
  },
  methods: {
     clkbtn(val){
        // $socket is socket.io-client instance
        this.$socket.emit('chat', 'nb');
    }
  }
};
</script>